//
// Created by redcat1 on 03.05.2024.
//

#ifndef TASK_ARRAY_TEST_DSL_H
#define TASK_ARRAY_TEST_DSL_H

#include <string>

#define TEST(suite_name, test_name) \
  void Test##suite_name##_##test_name()

#define RUN_TEST(suite_name, test_name) \
  Test##suite_name##_##test_name()

void OkMsg();
void ErrorMsg(const std::string& expected, const std::string& actual);

#define ASSERT_EQ(expected, actual) \
  if (expected == actual)           \
    OkMsg();                        \
  else                              \
    ErrorMsg(expected, actual);

#define ASSERT_NEAR(expected, actual, eps) \
  if (std::fabs(expected - actual) < eps)  \
    OkMsg();                               \
  else                                     \
    ErrorMsg(std::to_string(expected), std::to_string(actual));

#endif //TASK_ARRAY_TEST_DSL_H
